package com.mobisys.live.dao.mapper;

import com.mobisys.live.dao.model.RUserGroupUserKey;
import com.mobisys.live.dao.model.User;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface RUserGroupUserMapper {
    int deleteByPrimaryKey(RUserGroupUserKey key);

    int insert(RUserGroupUserKey record);

    int insertSelective(RUserGroupUserKey record);

    //获取目标用户组里的用户列表，分页获取
    List<User> selectUsersFromGroupByPage(@Param("groupId") String groupId, @Param("offset") int offset, @Param("size") int size);


    //批量添加用户到目标用户组
    int insertUsersToGroup(@Param("groupId") String groupId,@Param("userIdList")List<String> userIdList);


    //批量删除用户组里的用户
    int deleteUsersFromGroup(@Param("groupId") String groupId,@Param("userIdList")List<String> userIdList);

    //导入已有用户组里的用户到目标用户组
    int importGroupsToGroup(@Param("srcGroups") List<String> srcGroups, @Param("desGroup") String desGroup);

    //查询用户组列表里的用户，去除重复
    List<RUserGroupUserKey> selectUsersFromGroups(@Param("srcGroups") List<String> srcGroups, @Param("desGroup") String desGroup);
}